import { Request, Response } from "express";
import api from "./units/chat-gpt.js";

export async function baseService(req: Request, res: Response) {
  try {
    const { message } = req.params;

    const result = await api.sendMessage(message);

    res.status(200).send(result);
  } catch (error) {
    console.error(error);
    res.status(200).send(error);
  }
}
